import Vue from 'vue'
// 路由整合
import VueRouter from 'vue-router'
Vue.use(VueRouter)

// 导入对应的路由
// import discovery from './views/discovery.vue'
const discovery = () => import( /* webpackChunkName: "dis_play" */ './views/discovery.vue')
// import playlists from './views/playlists.vue'
const playlists = () => import( /* webpackChunkName: "dis_play" */ './views/playlists.vue')
// import songs from './views/songs.vue'
const songs = () => import( /* webpackChunkName: "songs_mvs_res" */ './views/songs.vue')
// import mvs from './views/mvs.vue'
const mvs = () => import( /* webpackChunkName: "songs_mvs_res" */ './views/mvs.vue')
// import result from './views/result.vue'
const result = () => import( /* webpackChunkName: "songs_mvs_res" */ './views/result.vue')
// import playlist from './views/playlist.vue'
const playlist = () => import( /* webpackChunkName: "play_mv" */ './views/playlist.vue')
// import mv from './views/mv.vue'
const mv = () => import( /* webpackChunkName: "play_mv" */ './views/mv.vue')

const router = new VueRouter({
    routes: [{
            path: '/',
            redirect: '/discovery'
        },
        {
            // 发现音乐
            path: '/discovery',
            component: discovery
        },
        {
            // 推荐歌单
            path: '/playlists',
            component: playlists
        },
        {
            // 推荐歌单
            path: '/playlist',
            component: playlist
        },
        {
            // 最新音乐
            path: '/songs',
            component: songs
        },
        {
            // 最新音乐
            path: '/mvs',
            component: mvs
        },
        // mv详情
        {
            path: '/mv',
            component: mv
        },
        // 搜索结果页
        {
            path: '/result',
            component: result
        }
    ]
})

export default router